<!DOCTYPE html>
We pass if we don't crash under ASAN.
<iframe id="iframe" src="../navigation/resources/blank.txt"></iframe>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

var iframe = document.getElementById("iframe");
var onload_completed = false;

function runGC() {
    gc();
    onload_completed = true;

}

function adoptAfterLoaded(ifr) {
    // Wait on onload's gc() to complete.
    if (!onload_completed) {
        setTimeout(function () { adoptAfterLoaded(ifr); }, 1);
        return;
    }
    document.adoptNode(ifr.attributes["src"]);
    if (window.testRunner)
        testRunner.notifyDone();
}

window.onload = function()
{
    iframe.remove();
    // Run the GC after this event handler has completed & back at the event loop.
    setTimeout(runGC);
}

document.addEventListener("DOMContentLoaded", function() {
    setTimeout(function () { adoptAfterLoaded(iframe); }, 1);
}, false);
</script>
